1 package jrre;
2
3 import jrre.gui.OperandFrameGui;
4
5 import jrre.types.*;
6 import java.beans.*;
7
8 public class OperandStack extends java.util.LinkedList {
9
10 private static OperandFrameGui operandFrameGui;
11
12 //private PropertyChangeSupport propertyChange = new PropertyChangeSupport(this);
13
14 static {
15 if(JRRE.guiOn()){
16 operandFrameGui = new OperandFrameGui();
17 }
18 }
19
20 public OperandStack(){
21
22 /*
23 if(JRRE.guiOn()){
24 operandFrameGui = new OperandFrameGui();
25 }
26 */
27 }
28
29 public void clear(){
30 if(JRRE.guiOn())
31 operandFrameGui.clear();
32 }
33
34 public void push(Type operand){
35
36 //propertyChange.firePropertyChange("pushing: "+operand, "old", "new");
37
38 if(JRRE.guiOn()){
39 operandFrameGui.push(operand.toString());
40 }
41 addLast(operand);
42 }
43
44 public Type pop(){
45 if(JRRE.guiOn())
46 operandFrameGui.pop();
47
48 if(size() > 0)
49 return (Type)removeLast();
50 else
51 return null;
52 }
53
54
55 /***
56 * Adds a listener to the collection of classes to notify when a
57 * property changes.
58 */
59 /*
60 public void addPropertyChangeListener(PropertyChangeListener listener) {
61 propertyChange.addPropertyChangeListener(listener);
62 }
63 */
64 }
65
This page was automatically generated by Maven